package com.baofu.paycore.service.processor.withdraw;

import com.baofu.paycore.manager.model.withdraw.WithdrawBO;
import com.baofu.paycore.service.converter.DTO2BOConverter;
import com.baofu.paycore.service.facade.model.withdraw.WithdrawDTO;
import com.baofu.paycore.service.processor.PayBaseProcessor;
import org.springframework.stereotype.Component;

/**
 * 提现主单处理类
 *
 * <p/>
 *      1、构建提现属性
 * </p>
 * User: LZQ Date: 2016/04/20  Version: 1.0
 */
@Component
public class WithdrawProcessor implements PayBaseProcessor<WithdrawBO, WithdrawDTO> {

    /**
     * 构建提现属性
     *
     * @param withdrawBO      支付模型
     * @param withdrawDTO     请求参数
     */
    @Override
    public PayBaseProcessor process(WithdrawBO withdrawBO, WithdrawDTO withdrawDTO) {

        //对象转换
        DTO2BOConverter.withdrawDTO2BO(withdrawDTO, withdrawBO);
        withdrawBO.setPayNo(withdrawBO.getPayNo());
        return this;
    }
}
